Component({
  data: {
    uiShowToast: false,
    message: '',
    type: ''
  },
  methods: {
    handleShow({ time = 3000, message = '', type = 'error' }) {
      this.setData({ uiShowToast: true, message, type })
      const timeKey = setTimeout(() => {
        this.handleHide()
      }, time);
    },
    handleHide() {
      this.setData({ uiShowToast: false })
    }
  }
})
